<template>
	<view class="pageView">
		<u-loading-page :loading="loading"></u-loading-page>
		<u-navbar
			title="课程详情"
			@leftClick="handleLeftClick"
			:autoBack="false"
		>
		</u-navbar>
		<view class="vedioBlock"></view>
		<view class="vedioContent">
			<view class="vedioContent-content">高情商攻略:情商认知提升很多人看完都要哭了</view>
			<view class="vedioContent-warnng">
				<view>213人播放</view>
				<view>213人点赞</view>
				<view>213人转发</view>
			</view>
		</view>
		<view class="classDetailBlock">
			<view class="classDetailBlock-title">课程详情</view>
			<scroll-view style="height: 55vh;" scorll-y="true"></scroll-view>
		</view>
	</view>
</template>

<script>
	import { getLearnDetail } from '@/api/common.js'
	export default {
		data() {
			return {
				loading: false,
				infoData: null
			}
		},
		onShow() {
			this.getInfoData()
		},
		methods: {
			getInfoData() {
				this.loading = true
				getLearnDetail({
					id: uni.getStorageSync('courseDetail').id,
					channel: uni.getStorageSync('channel')
				})
				.then(res => {
					const { code, data } = res
					if (code == 200001) {
						this.infoData = data
					}
					this.loading = false
				})
				.catch(e => {
					this.loading = false
				})
			},
			handleLeftClick() {
				uni.removeStorageSync('courseDetail')
				uni.navigateTo({
					url: '/pages/contentLearning/contentLearning'
				})
			}
		}
	}
</script>

<style lang="less">
	.pageView{
		background: #F4F4F4;
		height: 100%;
		.vedioBlock{
			width: 100%;
			height: 430rpx;
			background: #000;
		}
		.vedioContent{
			padding: 32rpx;
			background: #fff;
			&-content{
				font-family: Alibaba PuHuiTi 2.0, Alibaba PuHuiTi 20;
				font-weight: normal;
				font-size: 32rpx;
				color: #262626;
			}
			&-warnng{
				font-family: Alibaba PuHuiTi 2.0, Alibaba PuHuiTi 20;
				font-weight: normal;
				font-size: 24rpx;
				color: #999999;
				display: flex;
				justify-content: space-around;
				align-items: center;
			}
		}
		.classDetailBlock{
			margin-top: 20rpx;
			background: #fff;
			&-title{
				text-align: center;
				font-family: Alibaba PuHuiTi 2.0, Alibaba PuHuiTi 20;
				font-weight: normal;
				font-size: 26rpx;
				color: #626262;
				padding-top: 24rpx;
			}
		}
	}
</style>
